package com.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pojo.Student;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentDAO extends BaseMapper<Student> {


    // from Emp e where (?1 is null or e.empId=?1) and (?2 is null or e.empName like ?2) and (?3 is null or e.cs<=?3) and (?4 is null or e.cs>=?4)")
    @Select("select s.* from student s  join clss c on s.cid=c.id where (#{sname} is null or s.name=#{sname}) and (#{cname} is null or c.name=#{cname}) ")
    public IPage<Student> search(Page page, @Param("sname") String sname,@Param("cname") String cname);

}
